﻿using System.Collections.Generic;
using Flexible.Interfaces;

namespace Flexible.Framework
{
    class PluginActivateContext : IPluginActivateContext
    {
        readonly Dictionary<string, PluginActivator> requirements;
        readonly Dictionary<string, PluginActivator> interests;

        public Dictionary<string, PluginActivator> Requirements { get { return requirements; } }
        public Dictionary<string, PluginActivator> Interests { get { return interests; } }

        public PluginActivateContext()
        {
            requirements = new Dictionary<string, PluginActivator>();
            interests = new Dictionary<string, PluginActivator>();
        }

        #region IPluginActivateContext Members

        public IPlugin GetRequirement(string id)
        {
            return requirements[id].Plugin;
        }

        public IPlugin GetInterest(string id)
        {
            return interests[id].Plugin;
        }

        #endregion
    }
}
